<!DOCTYPE html>
<meta charset=utf-8>
<title>Syntax Highlighting</title>
<link href="../themes/css/blackboard.css" rel="stylesheet" type="text/css" media="screen">
<body>

<pre>
<code data-language="php">// this is some sample php code
$i = 0;
for ($i = 0; $i &lt; 25; ++$i) {
    echo $i;
}

# comment like this
function customFunction()
{
    return mt_rand(1, 100);
}

while ($test) {
    echo 'blah' . "\n";
};

$fruits = array('banana', 'strawberry', 'blueberry', 'apple', 'blackberry');

asort($fruits);

foreach ($fruits as $key => $value) {
    echo $value;
}</code>
</pre>

<pre>
<code data-language="php">&lt;?php
namespace Sonic;

/**
 * Util
 *
 * @category Sonic
 * @package Util
 * @author Craig Campbell
 */
class Util
{
    /**
     * deletes a directory recursively
     *
     * php's native rmdir() function only removes a directory if there is nothing in it
     *
     * @param string $path
     * @return void
     */
    public static function removeDir($path)
    {
        if (is_link($path)) {
            return unlink($path);
        }

        $files = new \RecursiveDirectoryIterator($path);
        foreach ($files as $file) {
            if (in_array($file->getFilename(), array('.', '..'))) {
                continue;
            }

            if ($file->isLink()) {
                unlink($file->getPathName());
                continue;
            }

            if ($file->isFile()) {
                unlink($file->getRealPath());
                continue;
            }

            if ($file->isDir()) {
                self::removeDir($file->getRealPath());
            }
        }
        return rmdir($path);
    }
}
</code>
</pre>

    <script src="../dist/rainbow.js"></script>
    <script src="../src/language/generic.js"></script>
    <script src="../src/language/php.js"></script>
</body>
